#include "inc/map.bi"

var mapname = "Wanted: Bomberman Test Map"
var mapdesc = "Dummy map for testing purposes"

kill "test.map"
open "test.map" for binary as #1

dim as integer i = MAP_NAME
dim as ubyte sh = TILE_BOUNDARY
dim as ubyte ub = MAP_DATA_NULL
dim as ubyte temp = 32

put #1, ,MAP_HEADER
put #1, ,i
put #1, ,len( mapname )
put #1, ,mapname
i = MAP_DESCRIPTION
put #1, ,i
put #1, ,len( mapdesc )
put #1, ,mapdesc
i = MAP_DATA
put #1, ,i
var p = LOC( 1 ) + 1
var s = 0
put #1, ,s 'come back later to write the size
put #1, ,temp 'x coord
put #1, ,temp 'y coord
for y as integer = 1 to 32
   if y = 17 then sh = TILE_FLOOR
   for x as integer = 1 to 32
      put #1, ,sh
      put #1, ,ub 'null descriptor
      s += 3
   Next
Next
print hex(p), hex(s)
put #1, p, s
seek #1, lof( 1 ) + 1
i = MAP_NUM_HEROES
put #1, ,i
i = 2
put #1, ,i
get #1, p, i
print hex(i)
close #1
sleep



